﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Lifang.Entites
{
    public partial class DP_ArticleContentValue
    {
        public const string Id = "Id";
        public const string ArticleId = "ArticleId";
        public const string Content = "Content";
        public const string ImageUrlOne = "ImageUrlOne";
        public const string ImageUrlTwo = "ImageUrlTwo";
        public const string ImageType = "ImageType";
        public const string DataFlag = "DataFlag";
        public const string IsDel = "IsDel";
        public const string CreateDateTime = "CreateDateTime";
        public const string CreateUserNo = "CreateUserNo";
        public const string CreateUserName = "CreateUserName";
        public const string UpdateDateTime = "UpdateDateTime";
        public const string UpdateUserNo = "UpdateUserNo";
        public const string UpdateUserName = "UpdateUserName";
    }

    public partial class DP_ArticleContent : IBaseDbEntity<DP_ArticleContent>
    {
        public DP_ArticleContent()
        {
            SetDefaultValue();
        }

        #region 方法
        public string GetPkName()
        {
            return "Id";
        }

        public int GetPkValue()
        {
            return Id;
        }


        public string GetDbName()
        {
            return "LifangDB";
        }

        public string GetTableName()
        {
            return "ArticleContent";
        }

        public string GetInsertSql()
        {
            return "INSERT INTO LifangDB.ArticleContent(ArticleId,Content,ImageUrlOne,ImageUrlTwo,ImageType,DataFlag,IsDel,CreateDateTime,CreateUserNo,CreateUserName,UpdateDateTime,UpdateUserNo,UpdateUserName)   VALUES (@ArticleId,@Content,@ImageUrlOne,@ImageUrlTwo,@ImageType,@DataFlag,@IsDel,@CreateDateTime,@CreateUserNo,@CreateUserName,@UpdateDateTime,@UpdateUserNo,@UpdateUserName);";
        }

        public string GetSelectSql()
        {
            return "SELECT Id,ArticleId,Content,ImageUrlOne,ImageUrlTwo,ImageType,DataFlag,IsDel,CreateDateTime,CreateUserNo,CreateUserName,UpdateDateTime,UpdateUserNo,UpdateUserName  FROM LifangDB.ArticleContent WHERE 1=1 ";
        }

        public string ColumnNameForSelect()
        {
            return "Id,ArticleId,Content,ImageUrlOne,ImageUrlTwo,ImageType,DataFlag,IsDel,CreateDateTime,CreateUserNo,CreateUserName,UpdateDateTime,UpdateUserNo,UpdateUserName";
        }

        public string ColumnNameForSelectParam()
        {
            return "@Id,@ArticleId,@Content,@ImageUrlOne,@ImageUrlTwo,@ImageType,@DataFlag,@IsDel,@CreateDateTime,@CreateUserNo,@CreateUserName,@UpdateDateTime,@UpdateUserNo,@UpdateUserName ";
        }

        public string ColumnNameForUpdate()
        {
            return "ArticleId,Content,ImageUrlOne,ImageUrlTwo,ImageType,DataFlag,IsDel,CreateDateTime,CreateUserNo,CreateUserName,UpdateDateTime,UpdateUserNo,UpdateUserName";
        }


        public string ColumnNameForUpdateParam()
        {
            return "@ArticleId,@Content,@ImageUrlOne,@ImageUrlTwo,@ImageType,@DataFlag,@IsDel,@CreateDateTime,@CreateUserNo,@CreateUserName,@UpdateDateTime,@UpdateUserNo,@UpdateUserName";
        }


        public Dictionary<string, string> GetFieldNotes()
        {
            return new Dictionary<string, string> { { "Id", "主键" }, { "ArticleId", "所属文章" }, { "Content", "内容" }, { "ImageUrlOne", "第一张图片" }, { "ImageUrlTwo", "第二张图片" }, { "ImageType", "图片类型" }, { "DataFlag", "有效性" }, { "IsDel", "是否删除" }, { "CreateDateTime", "创建时间" }, { "CreateUserNo", "创建人工号" }, { "CreateUserName", "创建人名" }, { "UpdateDateTime", "修改时间" }, { "UpdateUserNo", "修改人工号" }, { "UpdateUserName", "修改人名" }, };
        }

        public Dictionary<string, Type> GetFieldNames()
        {
            return new Dictionary<string, Type> { { "Id", typeof(int) }, { "ArticleId", typeof(int) }, { "Content", typeof(string) }, { "ImageUrlOne", typeof(string) }, { "ImageUrlTwo", typeof(string) }, { "ImageType", typeof(int) }, { "DataFlag", typeof(int) }, { "IsDel", typeof(int) }, { "CreateDateTime", typeof(DateTime) }, { "CreateUserNo", typeof(string) }, { "CreateUserName", typeof(string) }, { "UpdateDateTime", typeof(DateTime) }, { "UpdateUserNo", typeof(string) }, { "UpdateUserName", typeof(string) }, };
        }

        public void SetDefaultValue()
        {
            if (Content == null) { Content = String.Empty; }
            if (ImageUrlOne == null) { ImageUrlOne = String.Empty; }
            if (ImageUrlTwo == null) { ImageUrlTwo = String.Empty; }
            if (CreateDateTime.Year < 1900) { CreateDateTime = new DateTime(1900, 1, 1); }
            if (CreateUserNo == null) { CreateUserNo = String.Empty; }
            if (CreateUserName == null) { CreateUserName = String.Empty; }
            if (UpdateDateTime.Year < 1900) { UpdateDateTime = new DateTime(1900, 1, 1); }
            if (UpdateUserNo == null) { UpdateUserNo = String.Empty; }
            if (UpdateUserName == null) { UpdateUserName = String.Empty; }
        }


        public void SetPkValue(int pkVal)
        {
            Id = pkVal;
        }
        #endregion

        #region 字段

        /// <summary>
        /// 主键
        /// </summary>
        public System.Int32 Id { get; set; }

        /// <summary>
        /// 所属文章
        /// </summary>
        public System.Int32 ArticleId { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        public System.String Content { get; set; }

        /// <summary>
        /// 第一张图片
        /// </summary>
        public System.String ImageUrlOne { get; set; }

        /// <summary>
        /// 第二张图片
        /// </summary>
        public System.String ImageUrlTwo { get; set; }

        /// <summary>
        /// 图片类型  1大图 2小图
        /// </summary>
        public System.Int32 ImageType { get; set; }

        /// <summary>
        /// 有效性 0无效 1有效
        /// </summary>
        public System.Int32 DataFlag { get; set; }

        /// <summary>
        /// 是否删除  0未删除 1删除
        /// </summary>
        public System.Int32 IsDel { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public System.DateTime CreateDateTime { get; set; }

        /// <summary>
        /// 创建人工号
        /// </summary>
        public System.String CreateUserNo { get; set; }

        /// <summary>
        /// 创建人名
        /// </summary>
        public System.String CreateUserName { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public System.DateTime UpdateDateTime { get; set; }

        /// <summary>
        /// 修改人工号
        /// </summary>
        public System.String UpdateUserNo { get; set; }

        /// <summary>
        /// 修改人名
        /// </summary>
        public System.String UpdateUserName { get; set; }
        #endregion

    }
}
